package com.caj.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
//public class GatewayRoutesConfig {
//
//    @Bean
//    public RouteLocator pathRoute(RouteLocatorBuilder routeLocatorBuilder) {
//        //1、基于routeLocatorBuilder获取构建route的Builder
//        RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();
//        //2、设置route                                                         将uri修改为lb://服务名即可
//        return routes.route("path_route",route -> route.path("/order/**").uri("lb://order")).build();
//    }
//}
